package com.jiayou

import com.jiayou.config.vertx.VertxApplication
import io.vertx.core.AbstractVerticle
import io.vertx.core.Vertx
import io.vertx.core.impl.launcher.commands.VersionCommand
import org.mybatis.spring.annotation.MapperScan
import org.mybatis.spring.annotation.MapperScans
import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication
import org.springframework.context.ConfigurableApplicationContext

/**
@author lishuang
@data   2021-07-19  09:44:01
@info   vertx 启动类
 */
@MapperScan(value = ["com.jiayou.system"])
@SpringBootApplication
class VertxWebApplication {
    companion object {
        lateinit var vertxApp: Vertx

        @JvmStatic
        fun main(args: Array<String>) {
            val springApplication = runApplication<VertxWebApplication>(*args)
            val vertx = Vertx.vertx()
            vertx.deployVerticle(springApplication.getBean(AbstractVerticle::class.java))
            vertxApp = vertx
        }
    }
}